package com.sls.nzdapplication.ui.custom;

import android.content.Context;
import android.graphics.Color;
import android.text.Editable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.sls.nzdapplication.R;


public class MyCustomFormView extends LinearLayout {

    private TextView title;

    private EditText content;

    public MyCustomFormView(Context context) {
        super(context);
        ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
                .inflate(R.layout.my_custom_formview, this, true);
        initView();

    }

    public MyCustomFormView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public MyCustomFormView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
                .inflate(R.layout.my_custom_formview, this, true);
        initView();
    }

    private void initView(){
        title = findViewById(R.id.tv_title);
        content = findViewById(R.id.et_content);
    }

    public void setTitle(String titles){
//        title.setTextColor(Color.BLACK);
        title.setText(titles);
    }

    public void setContent(String contents){
//        content.setTextColor(Color.BLACK);
        content.setText(contents);
    }

    public String getValue(){
        return content.getText().toString();
    }

}
